(function(){
  var bss = window.location.search;
  console.log(bss);
  $.ajax({
    url:"http://192.168.23.25:3000/api/getcouponproduct"+bss+"",
    type:'get',
    datatype:'jsonp',
    success: function(data){
        var html = template("youhui",data);
        $("#ftitle").html(html);
        console.log(data.result[1].couponProductImg);
        //点击出现遮罩
        $("#ftitle").children().each(function(i,v){
          $(this).click(function(){
            $(".imgs").html($(this).find(".fl").html());
             console.log( $(".zhezhao").css("display"));
            if( $(".zhezhao").css("display")=="none"){
            // $("html").css("background","gray");
            $(".zhezhao").css("display","block");
           
            }
          
            $(".zhezhao").click(function(){
               $(".zhezhao").css("display","none");
            })
          
           
            $(".arrowr").click(function(e){
             e.stopPropagation();
             e.preventDefault();
             if(i<data.result.length){
                  $(".imgs").html(data.result[i].couponProductImg);
                  i=i+1;}
                })
            $(".arrowl").click(function(e){
              e.stopPropagation();
              e.preventDefault();
              if(i>=0){
                  $(".imgs").html(data.result[i].couponProductImg);
                  i=i-1;
                }
            })
          
          })
           
        })
    }
  })
})()
